added image sampling functionality --some errors
bugfix resize crop images