scan picture dynamically