Local studies of vortex distribution in superconducting (SC) thin films and their pinning by natural and artificial defects were performed using low-temperature magnetic force microscopy (MFM). The depinning of vortices by the MFM tip was visualized and the local pinning force was estimated in a good agreement with global transport measurements. It was shown that the presence of an ordered array of ferromagnetic dots being in a magnetic vortex state underneath the SC film significantly influences the natural pinning landscape of the superconductor leading to commensurate pinning effects. This strong pinning exceeds the repulsive interaction between the SC vortices and allows vortex clusters to be located at each dot. For industrially applicable YBCO films the main question discussed was a correlation between vortices and artificial defects as well as vortex imaging on rough thin films. Since the surface roughness causes a severe problem to the scanning tip, a nanoscale wedge polishing technique was developed. Mounting the sample under a defined small angle results in a smooth surface and a monotonic thickness reduction of the film along the length of the sample.